import 'package:android_base/pages/online/online.dart';
import 'package:fluro/fluro.dart';
import 'package:flutter/material.dart';
import 'package:android_base/pages/home/home.dart';
import 'package:android_base/pages/not_found.dart';

class Routes {
  static late final FluroRouter router = FluroRouter();

  static String home = "/";
  static String online = "/online";
  static void configureRoutes() {
    router.notFoundHandler = Handler(
      handlerFunc: (BuildContext? context, Map<String, List<String>> params) {
        print("ROUTE WAS NOT FOUND !!!");
        return Scaffold(appBar: AppBar(toolbarHeight: 0), body: NotFoundPage());
      },
    );
    Handler homeHandler = Handler(
      handlerFunc: (BuildContext? context, Map<String, List<String>> params) {
        return HomePage();
      },
    );
    Handler onlineHandler = Handler(
      handlerFunc: (BuildContext? context, Map<String, List<String>> params) {
        return OnlinePage();
      },
    );

    router.define(home, handler: homeHandler);
    router.define(online, handler: onlineHandler);
  }
}
